<?php
/**
 * (crontab)
 */
namespace App\Crontab\Minute\SpApi;

use App\Jobs\AmazonApi\SpApi\GrabAmazonOrder as GGrabAmazonOrder;
use App\Models\Basics\AmazonAccount;
class GrabAmazonOrder
{
    /**
     * 亚马逊订单同步
     * 每4分钟运行*\/4 3-22 * * * *
     */
    public static function grab(){
        $accounts = AmazonAccount::optionsForApi(['api' => 1]);
        $re = [];
        foreach ($accounts as $account){
            GGrabAmazonOrder::dispatch($account)->onQueue('sp-order');
            $re[$account->id] = true;
        }
        var_dump($re);
    }
}
